<?php /* SVN: $Id: $ */ ?>
<div class="blogs view">
<div class="l-curve-top">							
	<div class="r-curve-top">
			<div class="top-bg"></div>
							</div>
						</div>
						<div class="shad-bg-lft clearfix">
							<div class="shad-bg-rgt">
								<div class="shad-bg">
	<div class="main-section js-corner round-5">
				<h2 class="blog-title project-title"><?php echo $this->Html->cText($blog['Blog']['title']);?></h2>
								<div class="clearfix blogs-details">
					<div class="clearfix grid_left">
				<span>
					<span title="<?php echo __l('By');?>"><?php echo __l('By');?></span>
						<?php echo $this->Html->getUserAvatar($blog['Project']['User']['id'],'small_thumb'); ?>
											<cite><span title="<?php echo $blog['Project']['User']['username'];?>"><?php echo $this->Html->link($this->Html->cText($blog['Project']['User']['username']), array('controller'=> 'users', 'action' => 'view', $blog['Project']['User']['username']), array('escape' => false));?></span></cite>
					<span title="<?php echo __l('for');?>"><?php echo __l('for');?></span>
		            	<?php echo $this->Html->link($this->Html->showImage('Project', $blog['Project']['Attachment'], array('dimension' => 'small_thumb', 'alt' => sprintf(__l('[Image: %s]'), $this->Html->cText($blog['Project']['name'], false)), 'title' => $this->Html->cText($blog['Project']['name'], false)),array('aspect_ratio'=>1)), array('controller' => 'projects', 'action' => 'view', $blog['Project']['slug'], 'admin' => false), array('escape' => false));?>
		            <?php echo $this->Html->link($this->Html->cText($blog['Project']['name'],false),array('controller' => 'projects', 'action' => 'view',  $blog['Project']['slug'], 'admin' => false), array('escape' => false));?>

				</span>
				<span>
        			<em title="<?php echo __l('On');?>"><?php echo __l('On');?></em>
        			<span><?php echo $this->Html->cDateTimeHighlight($blog['Blog']['created']);?></span>
        		</span>
				</div>
				<div class="clearfix grid_right blogs-details-right">
				 <dl class="feature-list grid_left">
				<?php if(Configure::read('Project.is_project_update_comment_enabled')): ?>
        			<dt class="comments"><em title="<?php echo __l('Comments');?>"><?php echo __l('Comments');?></em></dt>
        			<dd><?php echo $this->Html->cInt($blog['Blog']['blog_comment_count']);?></dd>
                <?php endif; ?>
        			<dt class="views"><em title="<?php echo __l('Views');?>"><?php echo __l('Views');?></em></dt>
        			<dd><?php echo $this->Html->cInt($blog['Blog']['blog_view_count']);?></dd>
				</dl>
				<p class="grid_left">
        		<b><?php echo __l('Tags&#58;');?></b>
			
					<?php
						if (!empty($blog['BlogTag'])){
							foreach($blog['BlogTag'] As $blogtag) {
							echo $this->Html->link($this->Html->cText($blogtag['name'], false) , array('controller' => 'blogs', 'action' => 'index', 'tag' => $blogtag['slug']));
                    ?>
					<?php
							}
						} else {
					?>
								<p class="notice"><?php echo __l('No tags added');?></p>
					<?php
						}
					?>
				</p>
			</div>
			</div>
						<?php if ($blog['Project']['User']['id'] == $this->Auth->user('id')): ?>
				<p><?php echo $this->Html->link(__l('Edit'), array('controller' => 'blogs', 'action' => 'edit', $blog['Blog']['id']), array('class' => 'edit', 'escape' => false)); ?></p>
			<?php endif; ?>

			<p class="description"><?php echo $this->Html->cHtml($blog['Blog']['content']);?></p>	

		<?php if(Configure::read('Project.is_project_update_comment_enabled')): ?>

				<div class="js-responses blogComments-section">
					<?php echo $this->element('blog_comments-index', array('blog_id' => $blog['Blog']['id'], 'config' => 'sec', 'key' => $blog['Blog']['id'])); ?>
				</div>
			
			<div>
						<?php 
								if($this->Auth->user('id')):
									echo $this->element('../blog_comments/add');
								 else:?>
									   <p class="notice"><?php echo sprintf(__l('Please %s to post comment'), $this->Html->link(__l('login'), array('controller' => 'users', 'action' => 'login', '?' => 'f=blog/' . $blog['Blog']['slug']), array('title' => 'login'))) ;?></p>
							<?php endif; ?>
				<?php  ?>
			</div>
		<?php endif; ?>
	</div>
		</div>
							</div>
						</div>
						<div class="l-curve-bot">							
							<div class="r-curve-bot">
								<div class="bot-bg"></div>						
							</div>
						</div>
</div>